<!DOCTYPE html>
<body>
<script src="../../../resources/js-test.js"></script>
<script>
description("Tests the capture attribute of &lt;input type='file'&gt;");

var input = document.createElement("input");

shouldBeTrue("'capture' in input");
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");

input.setAttribute("type", "file");

shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");

input.setAttribute("capture", true);
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");

input.removeAttribute("capture");
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");

input.setAttribute("capture", "'x'");
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");

input.capture = false;
shouldBe("input.capture", "false");
shouldBe("input.hasAttribute('capture')", "false");

input.capture = true;
shouldBe("input.capture", "true");
shouldBe("input.hasAttribute('capture')", "true");
</script>
</html>
